class Point():
    x = 0.0
    y = 0.0

    def __init__(self, x, y):
        self.x = x
        self.y = y
        print('Point constructor')

    def toString(self):
        return '{X:' + str(self.x) + ',Y:' + str(self.y) + '}'


class Size():
    width = 0.0
    height = 0.0

    def __init__(self, width, height):
        self.width = width
        self.height = height
        print('Size constructor')

    def toString(self):
        return '{WIDTH=' + str(self.width) + \
            ',HEIGHT=' + str(self.height) + '}'


class Circle(Point):
    radius = 0.0

    def __init__(self, x, y, radius):
        super().__init__(x, y)
        self.radius = radius
        print('Circle constructor')

    def calcCircum(self):
        return 2 * 3.14159 * self.radius

    def toString(self):
        return super().toString() + \
            ',{RADIUS=' + str(self.radius) + '}'


class Ellipse(Point):
    horizontalRadius = 0.0
    verticalRadius = 0.0

    def __init__(self, x, y, horizontalRadius, verticalRadius):
        super().__init__(x, y)
        self.horizontalRadius = horizontalRadius
        self.verticalRadius = verticalRadius
        print('Ellipse constructor')

    def toString(self):
        return super().toString() + \
            ',{HORIZONTAL_RADIUS=' + str(self.horizontalRadius) + \
            ',VERTICAL_RADIUS='+str(self.verticalRadius) + '}'


class Rectangle(Point, Size):
    def __init__(self, x, y, width, height):
        Point.__init__(self, x, y)
        Size.__init__(self, width, height)
        print('Rectangle constructor')

    def calcArea(self):
        return self.width * self.height

    def toString(self):
        return Point.toString(self) + ',' + Size.toString(self)


p = Point(10, 20)
print(p.toString())

s = Size(80, 70)
print(s.toString())

c = Circle(100, 100, 50)
print(c.toString())
print('circumference:' + str(c.calcCircum()))

e = Ellipse(100, 100, 50, 30)
print(e.toString())

r = Rectangle(200, 250, 40, 50)
print(r.toString())
print('rectangle area:' + str(r.calcArea()))
